package org.gavin.service.impl;

import org.gavin.core.enums.SafetyType;
import org.gavin.core.service.safety.SafetyAbstract;
import org.gavin.core.utils.GMSM4Utils;
import org.springframework.stereotype.Service;

/**
 * DataBaseSafety
 *
 * @author grl
 * @date 2024/1/4
 */
@Service
public class DataBaseSafety implements SafetyAbstract {

    @Override
    public SafetyType TYPE() {
        return SafetyType.SM4;
    }

    @Override
    public String getEncrypt(String data) {
        return GMSM4Utils.encryptEcb(data, "22536AA8298D073537E95C754BB5EFD");
    }

    @Override
    public String getDecrypt(String data) {
        return GMSM4Utils.decryptEcb(data, "22536AA8298D073537E95C754BB5EFD");
    }
}
